# 有一个名为vars的内置函数，它返回这个不可见的字典
x = 1
scope = vars()
print(scope['x'])
scope['x'] += 1
print(x)


def foo():
    x = 42
    print(x)
    print(globals()['x'])
    # 私有作用域内


print(x)
foo()


# 闭包
def add_1(x):
    def add_2(x):
        return x+1
    return add_2(x+1)


print(add_1(233))



